package com.cqc.googleplay.utils;

import com.cqc.googleplay.application.MyApplication;

import android.content.Context;
import android.widget.Toast;

public class ToastUtil {

	private static Toast toast;
	/**
	 * 短吐司
	 * @param context
	 * @param text
	 */
	public static void showShortToast(Context context, String text) {
		if (toast == null) {
			toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
		}
		toast.setText(text);
		toast.show();
	}
	/**
	 * 长吐司
	 * @param context
	 * @param text
	 */
	public static void showLongToast(Context context, String text) {
		if (toast == null) {
			toast = Toast.makeText(context, text, Toast.LENGTH_LONG);
		}
		toast.setText(text);
		toast.show();
	}

	/**
	 * 短吐司
	 * @param text
	 */
	public static void showShortToast(String text) {
		if (toast == null) {
			toast = Toast.makeText(MyApplication.getContext(), text,
					Toast.LENGTH_SHORT);
		}
		toast.setText(text);
		toast.show();
	}

	/**
	 * 长吐司
	 * @param text
	 */
	public static void showLongToast(String text) {
		if (toast == null) {
			toast = Toast.makeText(MyApplication.getContext(), text,
					Toast.LENGTH_LONG);
		}
		toast.setText(text);
		toast.show();
	}
}
